<?php include "templates/include/header.php" ?>

      <div id="adminHeader">
        <h2>Administration du commite directeur</h2>
        <p>Vous etes connect&eacute; en tant que <b><?php echo htmlspecialchars( $_SESSION['username']) ?></b>. <a href="admin.php?action=logout"?>Se D&eacute;connecter</a></p>
      </div>

      <h1><?php echo htmlspecialchars( $results['pageTitle'] )?></h1>

      <form id="Upload" name="upload" enctype="multipart/form-data" action="admin.php?action=<?php echo $results['formAction']?>" method="post">
        <input type="hidden" name="hierarchyId" value="<?php echo $results['edit']->id ?>"/>

<?php if ( isset( $results['errorMessage'] ) ) { ?>
        <div class="errorMessage"><?php echo $results['errorMessage'] ?></div>
<?php } ?>
  <table align="center" width="90%" cellpadding="5px" cellspacing="0" border="0">
    <tr>
      <td valign="middle" align="center" style="margin:0;padding:0" align="left">
        <label for="image">Image :</label>
        <input id="file" type="file" name="file" maxlength="255" value="
          <?php echo htmlspecialchars( $results['edit']->image )?>"/>
        <img src="<?php echo htmlspecialchars( $results['edit']->image ); ?>" height="90px" width="70px" />
      </td>
      <td valign="bottom" align="center">
        <label for="name">Nom :</label>
        <input name="name" id="name" placeholder="Nom du membre" maxlength="255" value="
          <?php echo htmlspecialchars( $results['edit']->name )?>"/>
      </td>
      <td valign="bottom" align="center">
        <label for="groups">Groupe :</label>
        <select name="groups" id="groups">
          <option value="president" <?php if( $results['edit']->id ) {
			  if( $results['edit']->groups = "president" ) { echo( 'selected="yes"' ); }
	        } ?> >President</option>
          <option value="vice-president" <?php if( $results['edit']->id ) {
			  if( $results['edit']->groups = "vice-president" ) { echo( 'selected="yes"' ); }
			} ?> >Vice-President</option>
          <option value="secretariat" <?php if( $results['edit']->id ) {
			  if( $results['edit']->groups = "secretariat" ) { echo( 'selected="yes"' ); } 
			} ?> >Secretariat</option>
          <option value="tresorerie" <?php if( $results['edit']->id ) { if( $results['edit']->groups = "tresorerie" ) { echo( 'selected="yes"' ); } } ?> >Tresorerie</option>
        </select> 
      </td>
    </tr>
  </table>
        <div class="buttons">
          <input type="submit" name="upload" value="Enregister" />
          <input type="submit" formnovalidate name="cancel" value="Annuler" />
        </div>

      </form>

<?php if ( $results['edit']->id ) { ?>
      <p><a href="admin.php?action=deleteHierarchy&amp;hierarchyId=<?php echo $results['edit']->id ?>" onclick="return confirm('Delete This Article?')">Supprimer cet Article</a></p>
<?php } ?>

<?php include "templates/include/footer.php" ?>
